#ifndef KDCDISCEMODEL_H
#define KDCDISCEMODEL_H

#include <QAbstractItemModel>
#include <QList>

#include <kdcnamespace.h>
#include <kdcobject.h> 
#include <kdcdisc.h>
#include <kdcmovie.h>
#include <kdcmenu.h>
#include <kdcvts.h>

class KDCDiscModel : public QAbstractItemModel
{
public:
    KDCDiscModel( QObject *aParent = 0 );
    ~KDCDiscModel();

    int rowCount( const QModelIndex &aParent = QModelIndex() ) const;
    QVariant data( const QModelIndex &aIndex, int aRole = Qt::DisplayRole ) const;
    QModelIndex parent( const QModelIndex &aIndex ) const;
    int columnCount( const QModelIndex &aParent = QModelIndex() ) const;
    QModelIndex index( int aRow, int aColumn, const QModelIndex &aParent = QModelIndex() ) const;
    Qt::ItemFlags flags(const QModelIndex &aIndex ) const;
    QVariant headerData( int aSection, Qt::Orientation aOrientation, int aRole = Qt::DisplayRole ) const;
	
	void addObject( KDCDisc *aDisc, KDCMenu *aMenu );
	void addObject( KDCDisc *aDisc, KDCVTS *aVts );
	void addObject( KDCDisc *aDisc, KDCMovie *aMovie );
	void addObject( KDCDisc *aDisc );
	void addObject( KDCVTS *aVts, KDCMovie *aMovie );
	
	void removeObject( KDCDisc *aDisc, KDCMenu *aMenu, bool aDelete = false );
	void removeObject( KDCDisc *aDisc, KDCVTS *aVts, bool aDelete = false );
	void removeObject( KDCDisc *aDisc, KDCMovie *aMovie, bool aDelete = false );
	void removeObject( KDCDisc *aDisc, bool aDelete = false );
	void removeObject( KDCVTS *aVts, KDCMovie *aMovie, bool aDelete = false );
	
	KDCObject* objectFromIndex( const QModelIndex &aIndex ) const;
protected:
	QModelIndex indexFromObject( KDCObject *aObject ) const;
	void setupDVD( KDCMovie *aMovie ) const;
	void setupSVCD( KDCMovie *aMovie ) const;
	void setupVCD( KDCMovie *aMovie ) const;
	void setupCVD( KDCMovie *aMovie ) const;
private:
	QList<KDCDisc*> pDiscs;
};

#endif // KDCDISCEMODEL_H
